 package com.zhangjianling.premp.dao.sys;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.zhangjianling.premp.entity.sys.Dictionary;


public interface SysDictDao extends PagingAndSortingRepository<Dictionary, String>,
JpaSpecificationExecutor<Dictionary>{

	Dictionary findByName(Dictionary dict);

	@Query("select t from Dictionary t where t.parentDict IS NULL")
	List<Dictionary> findTopList();

	@Query("select t from Dictionary t where t.parentDict.dictId = ?1 and t.status='可用'")
	List<Dictionary> getChildres(String parentId);
}